package joindemo.domain.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import joindemo.common.enums.MessageType;
import joindemo.domain.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@TableName("tb_message")
public class Message extends BaseEntity{
    /**
     * 消息ID
     */
    @TableId(value="message_id",type = IdType.AUTO)
    private Long messageId;

    /**
     * 接收人ID
     */
    private Long userId;

    /**
     * 发送人ID
     */
    private Long fromUserId;

    /**
     *消息内容
     */
    private String content;

    /**
     * 消息类型
     */
    private MessageType messageType;

    /**
     * 是否已读
     */
    @TableField("is_read")
    private Boolean isRead;

    /**
     * 文章ID
     */
    private Long articleId;

    /**
     * 评论ID
     */
    private Long commentId;

}
